package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.po.MarketKeyword;
import com.cskaoyan.bean.po.MarketSearchHistory;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Trellis
 * @since 2022/09/08 21:10
 */
public class WxSearchIndexVo {

    /**
     * defaultKeyword : {"isDefault":true,"deleted":false,"addTime":"2018-02-01 00:00:00","sortOrder":1,"updateTime":"2018-02-01 00:00:00","id":6,"keyword":"520元礼包抢先领","url":"","isHot":true}
     * hotKeywordList : [{"isDefault":true,"deleted":false,"addTime":"2018-02-01 00:00:00","sortOrder":1,"updateTime":"2018-02-01 00:00:00","id":6,"keyword":"520元礼包抢先领","url":"","isHot":true},{"isDefault":false,"deleted":false,"addTime":"2022-09-06 19:29:07","sortOrder":100,"updateTime":"2022-09-06 19:29:07","id":9,"keyword":"zdd","url":"www.test.com","isHot":true},{"isDefault":false,"deleted":false,"addTime":"2022-09-07 16:32:02","sortOrder":100,"updateTime":"2022-09-07 16:32:02","id":19,"keyword":"wertwe","url":"asdfsadf","isHot":true},{"isDefault":true,"deleted":false,"addTime":"2022-09-07 19:26:59","sortOrder":100,"updateTime":"2022-09-08 14:35:08","id":22,"keyword":"12","url":"1","isHot":true},{"isDefault":true,"deleted":false,"addTime":"2022-09-07 19:29:36","sortOrder":100,"updateTime":"2022-09-07 19:29:36","id":23,"keyword":"22","url":"22","isHot":true},{"isDefault":true,"deleted":false,"addTime":"2022-09-07 21:38:16","sortOrder":100,"updateTime":"2022-09-08 09:13:12","id":25,"keyword":"教师节","url":"aaa","isHot":true},{"isDefault":true,"deleted":false,"addTime":"2022-09-08 09:54:12","sortOrder":100,"updateTime":"2022-09-08 10:17:58","id":28,"keyword":"PS5","url":"www.baidu.com","isHot":true},{"isDefault":false,"deleted":false,"addTime":"2022-09-08 20:16:18","sortOrder":100,"updateTime":"2022-09-08 20:50:00","id":36,"keyword":"key","url":"3620.com","isHot":true},{"isDefault":false,"deleted":false,"addTime":"2022-09-08 20:36:46","sortOrder":100,"updateTime":"2022-09-08 20:36:46","id":38,"keyword":"asd","url":"asd","isHot":true}]
     * historyKeywordList : []
     */
    private DefaultKeywordEntity defaultKeyword;
    private List<HotKeywordListEntity> hotKeywordList = new ArrayList<>();
    private List<MarketSearchHistory> historyKeywordList = new ArrayList<>();

    public void CopyDefaultKeyword(MarketKeyword keyword) {
        DefaultKeywordEntity keywordEntity = new DefaultKeywordEntity();
        BeanUtils.copyProperties(keyword,keywordEntity);
        defaultKeyword = keywordEntity;
    }

    public void CopyHotKeywordList(MarketKeyword keyword) {
        HotKeywordListEntity keywordListEntity = new HotKeywordListEntity();
        BeanUtils.copyProperties(keyword,keywordListEntity);
        hotKeywordList.add(keywordListEntity);
    }

    public void CopyHistoryKeywordList(MarketSearchHistory searchHistory) {
        historyKeywordList.add(searchHistory);
    }


    public void setDefaultKeyword(DefaultKeywordEntity defaultKeyword) {
        this.defaultKeyword = defaultKeyword;
    }

    public void setHotKeywordList(List<HotKeywordListEntity> hotKeywordList) {
        this.hotKeywordList = hotKeywordList;
    }

    public void setHistoryKeywordList(List<MarketSearchHistory> historyKeywordList) {
        this.historyKeywordList = historyKeywordList;
    }

    public DefaultKeywordEntity getDefaultKeyword() {
        return defaultKeyword;
    }

    public List<HotKeywordListEntity> getHotKeywordList() {
        return hotKeywordList;
    }

    public List<?> getHistoryKeywordList() {
        return historyKeywordList;
    }

    public class DefaultKeywordEntity {
        /**
         * isDefault : true
         * deleted : false
         * addTime : 2018-02-01 00:00:00
         * sortOrder : 1
         * updateTime : 2018-02-01 00:00:00
         * id : 6
         * keyword : 520元礼包抢先领
         * url :
         * isHot : true
         */
        private boolean isDefault;
        private boolean deleted;
        private String addTime;
        private int sortOrder;
        private String updateTime;
        private int id;
        private String keyword;
        private String url;
        private boolean isHot;

        public void setIsDefault(boolean isDefault) {
            this.isDefault = isDefault;
        }

        public void setDeleted(boolean deleted) {
            this.deleted = deleted;
        }

        public void setAddTime(String addTime) {
            this.addTime = addTime;
        }

        public void setSortOrder(int sortOrder) {
            this.sortOrder = sortOrder;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setKeyword(String keyword) {
            this.keyword = keyword;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public void setIsHot(boolean isHot) {
            this.isHot = isHot;
        }

        public boolean isIsDefault() {
            return isDefault;
        }

        public boolean isDeleted() {
            return deleted;
        }

        public String getAddTime() {
            return addTime;
        }

        public int getSortOrder() {
            return sortOrder;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public int getId() {
            return id;
        }

        public String getKeyword() {
            return keyword;
        }

        public String getUrl() {
            return url;
        }

        public boolean isIsHot() {
            return isHot;
        }
    }

    public class HotKeywordListEntity {
        /**
         * isDefault : true
         * deleted : false
         * addTime : 2018-02-01 00:00:00
         * sortOrder : 1
         * updateTime : 2018-02-01 00:00:00
         * id : 6
         * keyword : 520元礼包抢先领
         * url :
         * isHot : true
         */
        private boolean isDefault;
        private boolean deleted;
        private String addTime;
        private int sortOrder;
        private String updateTime;
        private int id;
        private String keyword;
        private String url;
        private boolean isHot;

        public void setIsDefault(boolean isDefault) {
            this.isDefault = isDefault;
        }

        public void setDeleted(boolean deleted) {
            this.deleted = deleted;
        }

        public void setAddTime(String addTime) {
            this.addTime = addTime;
        }

        public void setSortOrder(int sortOrder) {
            this.sortOrder = sortOrder;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setKeyword(String keyword) {
            this.keyword = keyword;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public void setIsHot(boolean isHot) {
            this.isHot = isHot;
        }

        public boolean isIsDefault() {
            return isDefault;
        }

        public boolean isDeleted() {
            return deleted;
        }

        public String getAddTime() {
            return addTime;
        }

        public int getSortOrder() {
            return sortOrder;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public int getId() {
            return id;
        }

        public String getKeyword() {
            return keyword;
        }

        public String getUrl() {
            return url;
        }

        public boolean isIsHot() {
            return isHot;
        }
    }
}
